<?php
namespace app\lib;

class Encryption
{
    //密码加密
    public static function encryption($password , $salt) {
        $password = md5(sha1($password).$salt);
        return $password;
    }
    //获取 salt
    public static function getsalt( $length = 4)
    {
        $salt= substr(md5(time()), 0, $length);//md5 加密，time() 当前时间戳
        return $salt;
    }
}
